Skip to content

Conversation

@cpatino-intive
Copy link
Contributor

[MBE]: Consolidate unspents for btc
Tasks: WP-4675

Copy link
Contributor

@mohammadalfaiyazbitgo mohammadalfaiyazbitgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments to address and please rebase & regenerate the api json.


const ConsolidateUnspentsResponse: HttpResponse = {
200: t.any,
202: t.any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where do you return a 202?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

};

const ConsolidateUnspentsResponse: HttpResponse = {
200: t.any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please type this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

};

export const ConsolidateUnspentsRequest = {
pubkey: t.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you have the walletId then you can just retrieve the pub key from the sdk

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the pubkey as a param in signing explicilty so they know they need to keep track of the pub. we still verify it against the pubkey on the wallet. can remove this in the future if we want

pubkey: t.string,
source: t.union([t.literal('user'), t.literal('backup')]),
walletPassphrase: t.union([t.undefined, t.string]),
xprv: t.union([t.undefined, t.string]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mohammadalfaiyazbitgo mentioned only xprv removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

const enclavedExpressClient = req.enclavedExpressClient;
const reqId = new RequestTracer();
const bitgo = req.bitgo;
const baseCoin = bitgo.coin((req as any).params.coin);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use req.decoded it will be already typed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment on lines 12 to 13
const params = (req as any).decoded;
const walletId = (req as any).params.walletId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to cast to any

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


try {
// Create custom signing function that delegates to EBE
const customSigningFunction = async (signParams: any) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be typed to any

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@cpatino-intive cpatino-intive force-pushed the WP-5142/consolidateunspents branch 2 times, most recently from a1a1bfc to 39e807a Compare June 26, 2025 18:29
};

export const ConsolidateUnspentsRequest = {
pubkey: t.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the pubkey as a param in signing explicilty so they know they need to keep track of the pub. we still verify it against the pubkey on the wallet. can remove this in the future if we want

export const ConsolidateUnspentsRequest = {
pubkey: t.string,
source: t.union([t.literal('user'), t.literal('backup')]),
walletPassphrase: t.union([t.undefined, t.string]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this please, we're not using wallet passhphrases with onprem

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@cpatino-intive cpatino-intive force-pushed the WP-5142/consolidateunspents branch from 1fb05c1 to 2f9826f Compare June 27, 2025 16:39
pranavjain97
pranavjain97 previously approved these changes Jun 27, 2025
@cpatino-intive cpatino-intive force-pushed the WP-5142/consolidateunspents branch from 620f4d6 to 58ae73d Compare July 3, 2025 18:20
@cpatino-intive cpatino-intive changed the base branch from master to WP-4793/utxo-accelerate July 3, 2025 18:21
pranavjain97
pranavjain97 previously approved these changes Jul 4, 2025
Base automatically changed from WP-4793/utxo-accelerate to master July 7, 2025 11:30
@cpatino-intive cpatino-intive dismissed pranavjain97’s stale review July 7, 2025 11:30

The base branch was changed.

feat(mbp): swagger update
@cpatino-intive cpatino-intive force-pushed the WP-5142/consolidateunspents branch from 1715fbb to 52e6a5a Compare July 7, 2025 15:14
@cpatino-intive cpatino-intive requested review from mohammadalfaiyazbitgo and removed request for mohammadalfaiyazbitgo July 7, 2025 18:56
@mohammadalfaiyazbitgo mohammadalfaiyazbitgo merged commit 47cef83 into master Jul 7, 2025
3 checks passed
@mohammadalfaiyazbitgo mohammadalfaiyazbitgo deleted the WP-5142/consolidateunspents branch July 7, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants